<!DOCTYPE html>
<html>
<head>
	<!-- Google Tag Manager -->
	<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
	new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
	j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
	'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
	})(window,document,'script','dataLayer','GTM-W8KNPT4');</script>
	<!-- End Google Tag Manager -->
	<meta charset="utf-8">
    <meta name="viewport" content="width=device-width,inital-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,minimal-ui">
    <meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
	<meta name="format-detection" content="telephone=no">
    <title>博猫体育</title>
    <link rel="stylesheet" href="css/app.min.css?ver=1.0.000">
    <link rel="stylesheet" href="css/iconfont.css?ver=1.0.000">
    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js" type="text/javascript"></script>
    <script src="js/pageLib.js"></script>
</head>
<body>
<div class="header -in-profile">
	<div class="nav">
		<div class="title">用户中心</div>
		<a href="sporttery.html" class="left-btn"><i class="iconfont icon-xitongfanhui icon-middle"></i></a>
		<!-- <div class="right-btn">登录 / 注册</div> -->
		<div class="right-btn"></div>
	</div>
</div>
<div class="profile">
	<!-- 已登录 -->

	<div class="preload-indicator">
		<span class="preloader"></span>
		<div style="color:#fff;">正在加载...</div>
	</div>
	<a class="balance-panel" href="javascript:;" style="display:none;">
		<!-- <div class="userhead-wrapper">
			<div class="headpic" style="background-image:url(images/defaulthead.png);"></div>
		</div>
		<div class="userinfo">
			<div class="nickname">唔准唔浪漫</div>
			<div class="info">钱包<span class="money">888元</span>　积分<span class="point">1246.7分</span></div>
		</div> -->
		<div class="label">账户余额</div>
		<div class="balance-amount">￥888.88</div>
		<div class="equal-to-currency">≈ 388.88元</div>
	</a>
	<!-- 未登录 -->
	<a class="userinfo unsigned inactive" href="login.html">
		<div class="userhead-wrapper">
			<div class="headpic" style="background-image:url(images/defaulthead.png);"></div>
		</div>
		<div class="userinfo">
			<div class="nickname">未登录</div>
			<div class="info"><span>马上注册开始投注</span></div>
		</div>
		<div class="loginbtn">登录/注册</div>
	</a>
	<div class="finance">
		<div class="item"><a class="addvalue" href="deposit.html">充值</a></div>
		<div class="item last"><a class="cash" href="withdrawal-ethereum.html">提款</a></div>
		<!-- <div class="item"><a class="changegift" href="#">活动</a></div> -->
	</div>
</div>
<div class="table-content -in-profile">
	<ul class="list menu-list">
		<!-- <li class="menu-cell">
			<a href="account-info.html" class="menu flexer">
				<div class="title">账号信息</div>
			</a>
		</li> -->
		<li class="menu-cell">
			<a href="orders-list.html" class="menu flexer">
				<div class="title">订单记录</div>
			</a>
		</li>
		<!-- <li class="menu-cell">
			<a href="#" class="menu flexer">
				<div class="title">帮助</div>
			</a>
		</li>
		<li class="menu-cell">
			<a href="#" class="menu flexer">
				<div class="title">帮助</div>
			</a>
		</li>
		<li class="menu-cell">
			<a href="#" class="menu flexer">
				<div class="title">帮助</div>
			</a>
		</li> -->
	</ul>
	<ul class="list menu-list">
		<li class="menu-cell">
			<a href="javascript:;" id="logout-btn" class="menu flexer">
				<div class="title">退出登录</div>
			</a>
		</li>
	</ul>
	<center class="userid" style="display:none;margin: 20px;font-size: 12px;color: #999;">用户编号：</center>
</div>

</body>
<script type="text/javascript">
$(document).ready(function(){
	pageLib.initAffiliate();
	pageLib.api({
		action: '/v1/user/get-user-info?t='+(new Date()).valueOf(),
		success: function(resp){
			
			var availableBalance='￥'+(parseFloat(resp.data.balance)+parseFloat(resp.data.frozen_cash)+parseFloat(resp.data.red_cash)).toFixed(2);
			pageLib.setCookie('balance',(parseFloat(resp.data.balance)+parseFloat(resp.data.frozen_cash)+parseFloat(resp.data.red_cash)),null);
			$('.balance-panel .balance-amount').text(availableBalance);
			$('.balance-panel .equal-to-currency').hide();
			$('.profile .preload-indicator').hide();
			$('.balance-panel').show();
			$('.userid').text('用户编号：'+resp.data.id).show();
			
		},
		error: function(XMLHttpRequest,err,exeption){
			if(XMLHttpRequest.status==401){
				window.location.href="login.html";
			}
		}
	});
	// 退出登录
	$('#logout-btn').on('click',function(){
		pageLib.logout(function(){
			window.location.href='sporttery.html';
		});
	})
});
</script>
</html>